<extend name="Index/index" />
<block name="main">
	<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<!-- <h2><i class="icon-user"></i> Members</h2> -->
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
						</div>
					</div>
					<div id="search">
		      		<form action="<{:U('index')}>" method='post'>
		      			 分类名称: <input type="text" name="name" class='search'>
		      			 <input class="button" type="submit" >
		     		 </form>
		    	</div>
					<a class="btn btn-info" href="<{:U('Category/index',array('id'=>$p2))}>">
						<i class="icon-edit icon-white"></i>  
						返回上一级分类 
					</a>
					<div class="box-content">
						<table class="table table-striped table-bordered bootstrap-datatable datatable">
						  <thead>
							  <tr>
								  <th>分类编号</th>
								  <th>分类名称</th>
								  <th>父级ID</th>
								  <th>分类路径</th>
								  <th>状态</th>
								  <th>操作</th>
							  </tr>
						  </thead>   
						  <tbody>
							<!-- start volist -->
							<empty name="list">
							<tr>
								<td colspan=6><{$row}></td>
							</tr>
							<else />
						  	<volist name="list" id="vo">

								<tr>
									<td><{$vo.id}></td>
									<td class="center"><{$vo.name}></td>
									<td><{$vo.pid}></td>
									<td><{$vo.path}></td>
									<td class="center"><a href="#" bz="<{$vo.id}>" class="btn btn-change label label-success icon-white bt"><if condition="$vo.display eq '1'">隐藏
									<else />显示</if></a></td>
									<td class="center">
										
										<a class="btn btn-info" href="<{:U('Category/edit',array('id'=>$vo['id']))}>">
											<i class="icon-edit icon-white"></i>  
											编辑                                            
										</a>
										<a class="btn btn-danger" href="<{:U('Category/delete',array('id'=>$vo['id']))}>">
											<i class="icon-trash icon-white"></i> 
											删除
										</a>
										<a class="btn btn-info" href="<{:U('Category/add',array('id'=>$vo['id']))}>">
											<i class="icon-edit icon-white"></i>  
											添加子分类 
										</a>
										<a class="btn btn-info" href="<{:U('Category/index',array('id'=>$vo['id']))}>">
											<i class="icon-edit icon-white"></i>  
											查看子分类 
										</a>
								
									</td>
								</tr>
							
							</volist> <!-- end volist -->
							</empty>
						  </tbody>
						  <{$page}>
					  </table>            
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
	<script>
		$(function () 
		{
			$('.bt').click(function ()
			{
				//console.log($(this).html());
				/*if ($(this).html() == '显示') {
					var lis = 1;
				} else {
					lis = 0;
				}*/
				//console.log(lis);
				var id = $(this).attr ('bz');
				_this = $(this);
				$.ajax (
				{
					type:'get',
					url:"<{:U('Category/update1')}>",
					data:{id:id},
					success:function (data)
					{
						_this.html(data);
					},
					
				})
			})
		})
	</script>
</block>